package com.chat.entry.po;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

import java.time.LocalDateTime;
import java.io.Serializable;

import com.chat.entry.enums.MessageType;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 用户聊天表
 * </p>
 *
 * @author author
 * @since 2025-08-21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("user_message")
@ApiModel(value = "UserMessage对象", description = "用户聊天表")
public class UserMessage implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "发送者id")
    private Integer senderId;

    @ApiModelProperty(value = "接受者id")
    private Integer receiverId;

    @ApiModelProperty(value = "发送内容")
    private String content;

    @ApiModelProperty(value = "消息类型 (1：文字， 2：emoji 3：图片， 4：视频)")
    private MessageType type;

    @ApiModelProperty(value = "发送时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime sendTime;

    @ApiModelProperty(value = "是否已读")
    private Integer readStatus;
}
